

GCC=gcc
CFLAGS=-std=gnu99
GCOVF=-fprofile-arcs -ftest-coverage

HEADERS=expression.h function.h program.h symtab.h
SOURCES=expression.c function.c main.c program.c symtab.c parser.tab.c scanner.yy.c
OBJS=expression.o function.o main.o program.o symtab.o

TARGET=sflo

all: $(HEADERS) $(SOURCES)
	$(GCC) $(CFLAGS) $(GCOVF) $(SOURCES) -o $(TARGET)

parser.tab.c: parser.y
	bison -d parser.y

scanner.yy.c: scanner.l parser.tab.c
	flex -oscanner.yy.c scanner.l

clean:
	rm -f *.o
	rm -f parser.tab.*
	rm -f scanner.yy.*
	rm -f *.gcov *.gcda *.gcno


